package org.simplecrm.controllers.events.propertyeditors;

import org.simplecrm.domain.event.eventtype.EventType;

import java.beans.PropertyEditorSupport;

/**
 * Created by oler on 16.09.14.
 */
public class EventTypePropertyEditor extends PropertyEditorSupport {

    @Override
    public void setAsText(String text) throws IllegalArgumentException {

        if (text.trim().equals("")) {
            return;
        }

        EventType eventType = new EventType();
        eventType.setId(Integer.parseInt(text));

        setValue(eventType);
    }
}
